package com.woniuxy.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.system.demol.entity.SystemDepot;
import com.woniuxy.system.mapper.SystemDepotMapper;
import com.woniuxy.system.service.SystemDepotService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 仓库详情表; 服务实现类
 * </p>
 *
 * @author why
 * @since 2023-09-08
 */
@Service
public class SystemDepotServiceImpl extends ServiceImpl<SystemDepotMapper, SystemDepot> implements SystemDepotService {

    @Resource
    private SystemDepotMapper systemDepotMapper;
    @Override
    public Page<SystemDepot> searchAll(Integer num, String input, Integer currentPage, Integer pageSize) {
        QueryWrapper<SystemDepot> wrapper = new QueryWrapper<>();

        wrapper.like("account", input).or().like("description", input);
        Page<SystemDepot> systemDepotPage = systemDepotMapper.selectPage(new Page<>(currentPage, pageSize), wrapper);
        return systemDepotPage;
    }
}
